<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.lmpop.trade.ti_channel.*"%>	
<%@ page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo"%>	
<jsp:useBean id="bean" class="com.lmpop.frame.util.RandomID" scope="page" /> 
<%
 
	request.setCharacterEncoding("UTF-8");
	String ch_id = bean. GenTradeId ();

	String up_ch_id = "";
	if(request.getParameter("up_ch_id") != null){
		up_ch_id = request.getParameter("up_ch_id");
	}else{
		up_ch_id = "000000000000000";
	}
	
	Ti_channelInfo info = new Ti_channelInfo();
	String upchid ="";
	upchid =info.getUp_ch_id(up_ch_id );
	if( upchid.equals(""))
	{
		upchid ="000000000000000"; 
		}	
	String 
    save_dir = "";
	save_dir = info.getUpFilePath(up_ch_id);	
	String up_ch_level = "1";
	if(request.getParameter("up_ch_level") != null)
	{
		up_ch_level = request.getParameter( "up_ch_level" );
	}
	else if(up_ch_id.equals("000000000000000"))
	{
		up_ch_level = info.getUpChannelLevel(up_ch_id);
		if(up_ch_level.equals("")){
			up_ch_level="1";
		}
	}
	else 
	{
		up_ch_level  = String.valueOf(Integer.parseInt(info.getSelfChannelLevel(up_ch_id))+1) ;
		 
	}
	String up_ch_name="";
	if(!up_ch_id.equals("")){
	up_ch_name = info.getChName(up_ch_id);
		}
	if(up_ch_name.equals("")){
		up_ch_name="无上级栏目";
	}
 
	
	
	
	Tb_commparaInfo compara = new Tb_commparaInfo();
	String modelSelect = compara.getSelectItem("32","modle");
 
	String index_temp="";
	if(request.getParameter("index_temp") !=null)
		index_temp=request.getParameter("index_temp") ;
	
%>
	
<html>
  <head>
    <title>新增栏目</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
     <link href="/program/admin/index/css/thickbox.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/jquery.js"></script>
	<script type="text/javascript" src="/js/thickbox.js"></script>
	<script type="text/javascript" src="channel.js"></script>
	<script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script>
	</head>
 


<body>
	<h1>新增栏目</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm" id="addForm" target="_self">
 
	   <input name="in_date" id="in_date" type="hidden" />
	   <input name="ch_id" id="ch_id" type="hidden" value="<%=ch_id%>"/>
	   <input name="web_id" id="web_id" type="hidden" value="100000000000000"/>
	   <input name="ch_level" id="ch_level" type="hidden" value="<%=up_ch_level%>"/>
	   
	   	<table width="100%" cellpadding="1" cellspacing="1" border="0"  class="listtab">
		<tr>
			<td align="right" width="16%">
				栏目名称<font color="red">*</font>
			</td>
			<td colspan="3"><input name="ch_name" id="ch_name" maxLength="30" size="50"  type="text" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) " onBlur="checkChannelName()"/></td>
		
		</tr>
		<tr>
	      <td  align="right" width="16%">默认页面:</td>
				<td align="left" width="21%"><input name="default_page" id="default_page" type="text" value="index.html" maxLength="30" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) " /></td>
				<td align="right" width="10%">栏目标识:</td>
				<td><%=ch_id%></td>
		</tr>
			   
 
	  <tr>
					<td align="right" width="16%">
						栏目级别:
					</td>
					<td align="left" width="21%"><%=up_ch_level%></td>
					
					<td align="right" width="10%">显示顺序:</td>
					<td><input name="sort" id="sort" type="text" value="1" style="width:80px;" maxlength="4" onKeyUp="if(!/^[0-9][0-9]*$/.test(this.value))this.value=''">(由低 -> 高)</td>			  
		</tr>			
				
				
				
		<tr>
			<td align="right" width="16%">
				上级栏目:
			</td>
			<td align="left" width="21%" colspan="3">
				<%=up_ch_name%>
				<input name="up_ch_id" type="hidden" id="up_ch_id" value="<%=up_ch_id%>" />	
			</td>
		</tr>

		<tr>
			<td align="right" width="16%">
				生成文件保存路径:
			</td>
			<td colspan="3">
			<input name="save_dir" type="text" id="save_dir" value="<%=save_dir%>" size="50" maxlength="100" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this);  " />
								<input name="dir" type="hidden" id="dir" size="30" maxlength="100" />
								<input name="save_dir_cc" type="hidden" id="save_dir_cc" value="<%=save_dir%>" />
								<input name="save_dir_again" type="hidden" id="save_dir_again" value="" /></td>
		</tr>
		
		
		
		<tr>
			<td align="right" width="16%">
				首页模板路径:
			</td>
 
 
			<td colspan="3">
			<input type="text" id="index_temp" name="index_temp" value="<%=index_temp %>" size="50" maxlength="100" readonly="readonly">
		   <input type="button" onClick="choiceFile('add','')" value="浏览"/>	
			
				</td>
		</tr>
		
		<tr>
			<td align="right" width="16%">
				外部链接:
			</td>
			<td colspan="3"><input type="text" name="out_link" id="out_link" value="" size="50" maxlength="100" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) "></td>
		</tr>
		
		<tr>
			<td align="right" width="16%">
				关键字:
			</td>
			<td colspan="3"><input type="text" name="meta_keyword" id="meta_keyword" value="" size="50" maxlength="100" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) "></td>
		</tr>

		<tr>
			<td align="right" width="16%">
				描述概括:
			</td>
			<td colspan="3"><textarea name="meta_desc" id="meta_desc" rows="3" cols="40" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) "></textarea></td>
		</tr>		
		
		<tr>
			<td align="right" width="16%">
				备注:
			</td>
			<td colspan="3"><input name="remark" id="remark" type="text" size="50" maxLength="50" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this) " /></td>
			</tr>
	</table>
	
	<table width="70%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="5720" />
				<input class="buttoncss" type="button" name="tradeSub" value="提交" onClick="return chekedinfo()"/>&nbsp;&nbsp;
				<input class="buttoncss" type="button" name="tradeRut" value="返回" onClick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
